# -*- coding: utf-8 -*-

'''eof
name:经营规模
code:CustSize
tableName:
columnName:
groups:烟商
dependencies:BTM
type:常用指标
datasourceType:在线指标
description:
eof'''

import sys
import pandas as pd
import datetime

reload(sys)
sys.setdefaultencoding('utf-8')

def CustSize():
    null_type_list = ['', None, 'null', 'Null', '/', ' ']
    cust_size = [u'大', u'中', u'小']
    try:
        BTM_ = BTM['data']
    except:
        return u'缺失值'

    try:
        if BTM_.has_key('indent') and BTM_['indent'] not in null_type_list \
            and BTM_.has_key('custSize') and BTM_['custSize'] not in null_type_list \
                and BTM_['custSize'] in cust_size:
            return BTM_['custSize']
        else:
            return u'缺失值'
    except:
        return u'缺失值'

result = CustSize()